<?php

header("Content-Type:text/html; charset=gb2312");

require "./include/common.inc.php";

if (submitcheck("commentpage"))
{
   	$teacheraid = iconv("UTF-8", "gb2312", $teacheraid);
    $teachername = iconv("UTF-8", "gb2312", $teachername);
    $teachername = str_replace(":", "", $teachername);
    $averageScore = CalculateAverage($teacheraid);
    $averageScore = round($averageScore, 1);
    $averageScore = number_format($averageScore, 1);
    $commentContentstr = OutputComments($teacheraid, 5);
    $commentContent = explode("&", $commentContentstr);
    include template("comment");
}

if(submitcheck("commentsubmit"))
{
    $commentteacheraid = iconv("UTF-8", "gb2312", $commentteacheraid);
    $commentscore = iconv("UTF-8", "gb2312", $commentscore);
    $commentcontent = iconv("UTF-8", "gb2312", $commentcontent);
    $result = ImportComment($uid, $commentteacheraid, $commentcontent, "", $commentscore);
}


?>